<?php
	session_start();

	date_default_timezone_set("Asia/Shanghai");
	//文件位置，用于引入文件和操作文件
	$admin_dir = __DIR__;
	$project_dir = dirname($admin_dir);
	$lib_dir = $project_dir.DIRECTORY_SEPARATOR.'lib';
	$config_dir = $project_dir.DIRECTORY_SEPARATOR.'config';
	$plugin_dir = $project_dir.DIRECTORY_SEPARATOR.'plugin';

	//解析配置文件
	$config = parse_ini_file($config_dir.DIRECTORY_SEPARATOR.'config.ini');
	//配置网络地址，用于插件和样式的引用
	define('__PUBLIC__', $config['local'].'/public');
	define('__PLUGIN__', $config['local'].'/plugin');

	$adminUrl=$config['local'].'/admin';
	$loginOutLink=$config['local'].'/admin/loginout.php';
	$loginUrl=$config['local'].'/admin/login.php';
	if(!isset($_SESSION['userid'])||$_SESSION['userid']<1){
		header("location:".$loginUrl);
		exit;
	}
	include $lib_dir.DIRECTORY_SEPARATOR.'db.php';
	include $lib_dir.DIRECTORY_SEPARATOR.'page.class.php';

	$mysql = new MysqlDb($config['host'],$config['user'],$config['pass'],$config['name'],$config['charset']);

	//引入无限极分类函数文件
	include $admin_dir.DIRECTORY_SEPARATOR.'lib/functionCategory.php';